var app = angular.module("my-app",[]);

app.controller("test",function () {

});

//添加镜头
app.controller("addcamera",function ($scope,$http) {

    $scope.submit = function () {
        $http({
            method:"post",
            url:"/admin/camera/addDo",
            data:$scope.camera
        }).then(function(data){
            if (data.data.code === 200){
                layer.msg('添加成功!',{icon:1,time:1000},function () {
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.$('.btn-refresh').click();
                    parent.layer.close(index);
                });
            }else{
                layer.msg('error:'+data.desc,{icon:1,time:1000});
            }
        })
    }
})